{$contents}

{literal}
<div style="text-align:left; padding:10px;">
<h2>Source</h2>

<pre class="code">
&lt;?php
$date1 = date('Y-m-d', strtotime('+1 day'));
$date2 = date('Y-m-d', strtotime('+5 day'));
$someData = array(
	$date1 => array('text'=>'Meet with someone', 'color'=>'red'),
	$date2 => array('text'=>'Meet with someone else', 'color'=>'blue'),	
);

function dayHandler( DomFgCalendarDay $day, $someData ) {
	$date = date('Y-m-d', $day->stamp );
	$day->style = 'width:100px; height:100px;';
	return '&lt;div style="color:'.$someData[$date]['color'].'"&gt;'.$someData[$date]['text'].'&lt;/div&gt;';
}
		
$panel = array(
	'title' => 'Kalender',
	'layout' => 'table',
	'style' => 'width:800px',
	'items' => array(
		array(
			'type' => 'calendar',
			'start' => date('Y-m-d'),
			'end' => date('Y-m-d', strtotime('+100 days')),
			'monthStyle' => 'border: 1px dotted lightgrey; margin-bottom: 5px; ',
			'dayHandler' => 'dayHandler',
			'dayHandlerArgs' => array($someData),
		),
	),	
);
$this->view->contents = DomFg::render( $panel );
?&gt;
</pre>
</div>
{/literal}